package org.electronic.registration.bo;

import java.util.Date;

/**
 * User: Egor
 * Date: 09.01.12
 */
public class Scheduler {

    private Integer Id;
    private Date startDate;
    private Date endDate;
    private Doctor doctor;
    private Patient patient;
    private int backgroundColor = 13421772;

    public Scheduler() {
    }

    public Scheduler(Integer id, Date startDate, Date endDate, Doctor doctor, Patient patient) {
        Id = id;
        this.startDate = startDate;
        this.endDate = endDate;
        this.doctor = doctor;
        this.patient = patient;
    }

    public Scheduler(Integer id, Date startDate, Date endDate, Doctor doctor, Patient patient, int backgroundColor) {
        Id = id;
        this.startDate = startDate;
        this.endDate = endDate;
        this.doctor = doctor;
        this.patient = patient;
        this.backgroundColor = backgroundColor;
    }

    public Integer getId() {
        return Id;
    }

    public void setId(Integer id) {
        Id = id;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Doctor getDoctor() {
        return doctor;
    }

    public void setDoctor(Doctor doctor) {
        this.doctor = doctor;
    }

    public Patient getPatient() {
        return patient;
    }

    public void setPatient(Patient patient) {
        this.patient = patient;
    }

    public int getBackgroundColor() {
        return backgroundColor;
    }

    public void setBackgroundColor(int backgroundColor) {
        this.backgroundColor = backgroundColor;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Scheduler scheduler = (Scheduler) o;

        if (Id != null ? !Id.equals(scheduler.Id) : scheduler.Id != null) return false;
        if (doctor != null ? !doctor.equals(scheduler.doctor) : scheduler.doctor != null) return false;
        if (endDate != null ? !endDate.equals(scheduler.endDate) : scheduler.endDate != null) return false;
        if (patient != null ? !patient.equals(scheduler.patient) : scheduler.patient != null) return false;
        if (startDate != null ? !startDate.equals(scheduler.startDate) : scheduler.startDate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = Id != null ? Id.hashCode() : 0;
        result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
        result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
        result = 31 * result + (doctor != null ? doctor.hashCode() : 0);
        result = 31 * result + (patient != null ? patient.hashCode() : 0);
        return result;
    }
}
